import 'package:flutter/material.dart';

///单子布局主要有Align、Center、Padding、Margin、Container等
///Expanded
class SingleChildWidgetPage extends StatefulWidget {
  @override
  _SingleChildWidgetPageState createState() => _SingleChildWidgetPageState();
}

class _SingleChildWidgetPageState extends State<SingleChildWidgetPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('单子布局')),
      body: Center(
        child: Container(
          decoration: BoxDecoration(
              color: Colors.amber,
              border: Border.all(color: Colors.red, width: 3, style: BorderStyle.solid),
              borderRadius: BorderRadius.circular(20),
              boxShadow: [BoxShadow(offset: Offset(2, 2), color: Colors.grey, blurRadius: 50)]),
          padding: EdgeInsets.all(25),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              Center(child: Icon(Icons.icecream, size: 36, color: Colors.red), widthFactor: 3)
            ],
          ),
        ),
      ),
    );
  }
}
